package com.springcloud.atguigu.controller;

import com.springcloud.atguigu.domain.CommonResult;
import com.springcloud.atguigu.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * @author :hucaiyuan
 * @date :2022/02/26   15:13
 * @description :
 */
@RestController
public class AccountController {

    @Autowired
    private AccountService accountService;

    @RequestMapping(value = "/account/decrease")
    public CommonResult decrease(Long userId, BigDecimal money){
          accountService.decrease(userId,money);
          return new CommonResult(200,"扣减余额成功!");
    }
}
